<template>
	<el-container direction="vertical">
		<el-header>
			<div class="left-panel">
				<el-button @click="deleteList" type="danger">批量删除</el-button>
			</div>
		</el-header>
		<el-main class="nopadding">
			<scTable
				ref="table"
				v-bind="list"
				row-key="id"
				stripe
				:setUpType="false"
				:hidePropOrder="true"
			>
				<el-table-column type="selection" width="50"></el-table-column>
        <el-table-column label="操作" width="255" fixed="right" align="center">
          <template #default="scope">
				  	<el-button plain size="small" type="primary" @click="viewDetail(scope.row)">查看</el-button>
				  	<el-button plain size="small" type="success" @click="viewDetail(scope.row)">接受</el-button>
				  	<el-button plain size="small" type="danger" @click="viewDetail(scope.row)">拒接</el-button>
          </template>
        </el-table-column>
			</scTable>
		</el-main>
	</el-container>
</template>

<script setup>
import { ElMessage, ElMessageBox } from 'element-plus'
import { ref, getCurrentInstance } from "vue";
const { proxy } = getCurrentInstance()

const list = ref({
	apiObj: proxy.$API.clue.list,
	params: {},
	column: [
    {
    	label: "学员姓名",
    	prop: "studentName",
    	width: "200",
    },
    {
    	label: "推送人",
    	prop: "Pusher",
    	width: "300",
    },
    {
    	label: "推送时间",
    	prop: "pushTime",
    	width: "350",
    },
  ]
})

const table = ref(null)
// 批量删除
const deleteList = () => {
	const tableSelection = table.value.tableSelection;
	if (tableSelection.length > 0) {
		ElMessageBox.confirm('确认删除?','信息',
		 	{
		 	  confirmButtonText: '确定',
		 	  cancelButtonText: '取消',
				buttonSize: "small"
		 	}
		).then(() => {}).catch(() => {})
	}else{
		ElMessage({
			message: "请选择信息",
			type: "warning"
		})
	}
}

const viewDetail = (row) => {
  console.log(row);
}
</script>

<style lang="scss" scoped>
.dialog-content {
	.el-select  {
		width: 100%;
	}
	.textarea {
		&>div:nth-child(1) {
			padding-bottom: 10px;
			color: #666666;
		}

		&>div {
			::v-deep .el-textarea {
				.el-textarea__inner {
					min-height: 172px !important;
				}
			}
		}
	}
}
</style>
